//
//  AttributedTextFieldCell.h
//  Tabletest
//
//  Created by Dave MacLachlan on 07/08/29.
//  Copyright 2007 Google Inc. All rights reserved.
//

#import "AttributedTextFieldCell.h"


@implementation AttributedTextFieldCell

- (id)initTextCell:(NSString *)aString {
  if ((self = [super initTextCell:aString])) {
    [self setAllowsEditingTextAttributes:YES];
  }
  return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
  if ((self = [super initWithCoder:aDecoder])) {
    [self setAllowsEditingTextAttributes:YES];
  }
  return self;
}

- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj {
  NSText *field = [super setUpFieldEditorAttributes:textObj];
  NSColor *color = [self backgroundColor];
  if ([color isEqualTo:[NSColor clearColor]]) {
    color = [[[self controlView] window] backgroundColor];
  }
  [field setBackgroundColor:color];
  return field;
}

@end
